package com.hl.card.common.util;

import java.util.HashMap;
import java.util.Map;


public class ResponseUtil {
	
	  public static ResponseObject staticErrorCode(Integer erroCode){
	        ResponseObject ob=new ResponseObject();
	        ob.setErroCode(erroCode);
	        return ob;
	    }
	    public static ResponseObject staticObject(Integer erroCode,Object data){
	        ResponseObject ob=new ResponseObject();
	        ob.setErroCode(erroCode);
	        ob.setData(data);
	        return ob;
	    }

    public static ResponseObject SUCCESS(){
	        ResponseObject ob=new ResponseObject();
	        ob.setErroCode(0);
	        return ob;
	    }

    public static ResponseObject SUCCESS(Object data){
	        ResponseObject ob=new ResponseObject();
	        ob.setErroCode(0);
	        ob.setData(data);
	        return ob;
	    }

    public static ResponseObject SUCCESS(String key,String value){
	        Map<String,String> map=new HashMap<>();
	        map.put(key,value);
	        ResponseObject ob=new ResponseObject();
	        ob.setErroCode(0);
	        ob.setData(map);
	        return ob;
	    }

    public static ResponseObject ERROR(){
	        ResponseObject ob=new ResponseObject();
	        ob.setErroCode(1);
	        return ob;
	    }

    public static ResponseObject ERROR(Object data){
	        ResponseObject ob=new ResponseObject();
	        ob.setErroCode(1);
	        ob.setData(data);
	        return ob;
	    }

    public static ResponseObject ERROR(String key,String value){
	        Map<String,String> map=new HashMap<>();
	        map.put(key,value);
	        ResponseObject ob=new ResponseObject();
	        ob.setErroCode(1);
	        ob.setData(map);
	        return ob;
	    }

}




